import React, { Component } from 'react'

export default class Index extends Component {
  // 实例属性
  state = {
    info: [
      { id: 1001, name: '麦当劳', price: 28 },
      { id: 1002, name: 'KFC', price: 18 },
      { id: 1003, name: '猪脚饭', price: 18 },
      { id: 1004, name: '螺蛳粉', price: 14 }
    ]
  }
  render () {
    return (
      <div>
        {this.state.info.map(item => {
          return (
            <div key={item.id}>
              name is {item.name} price id {item.price}
            </div>
          )
        })}
      </div>
    )
  }
}
